package com.cloudpark.model.entity;

import java.util.Date;

import com.cloudpark.common.util.BaseEntity;
import com.cloudpark.common.util.ObjectUtil;

public class ParkOrder extends BaseEntity {
    private Long id;

    private String openId;

    private String orderNo;

    private String plateNumber;

    private Double payableFee;

    private Double paidFee;

    private Double discountFee;

    private Integer payType;

    private Integer type;

    private Integer payChannel;

    private Long opId;

    private String opName;

    private String parkCode;

    private Long estateId;

    private Date createdTime;
    
    private Date payTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId == null ? null : openId.trim();
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo == null ? null : orderNo.trim();
    }

    public String getPlateNumber() {
        return plateNumber;
    }

    public void setPlateNumber(String plateNumber) {
        this.plateNumber = plateNumber == null ? null : plateNumber.trim();
    }

    public Double getPayableFee() {
        return payableFee;
    }

    public void setPayableFee(Double payableFee) {
        this.payableFee = payableFee;
    }

    public Double getPaidFee() {
        return paidFee;
    }

    public void setPaidFee(Double paidFee) {
        this.paidFee = paidFee;
    }

    public Double getDiscountFee() {
        return discountFee;
    }

    public void setDiscountFee(Double discountFee) {
        this.discountFee = discountFee;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(Integer payChannel) {
        this.payChannel = payChannel;
    }

    public Long getOpId() {
        return opId;
    }

    public void setOpId(Long opId) {
        this.opId = opId;
    }

    public String getOpName() {
        return opName;
    }

    public void setOpName(String opName) {
        this.opName = opName == null ? null : opName.trim();
    }

    public String getParkCode() {
        return parkCode;
    }

    public void setParkCode(String parkCode) {
        this.parkCode = parkCode == null ? null : parkCode.trim();
    }

    public Long getEstateId() {
        return estateId;
    }

    public void setEstateId(Long estateId) {
        this.estateId = estateId;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

	/**
	 * @return the payTime
	 */
	public Date getPayTime() {
		return payTime;
	}

	/**
	 * @param payTime the payTime to set
	 */
	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}
	
	@Override
	public String toString() {
		return "Order [id=" + id + ", openId=" + openId + ", orderNo="
				+ orderNo + ", plateNumber=" + plateNumber + ", payableFee="
				+ payableFee + ", paidFee=" + paidFee + ", discountFee="
				+ discountFee + ", payType=" + payType + ", type=" + type
				+ ", payChannel=" + payChannel
				+ ", opId=" + opId + ", opName=" + opName + ", parkCode="
				+ parkCode+ ", estateId="
                + estateId + ", createdTime=" + createdTime + ", payTime="
				+ payTime + "]";
	}

	public void copy(ParkOrderTemp orderTemp) {
		this.setOpenId(orderTemp.getOpenId());
		this.setOrderNo(orderTemp.getOrderNo());
		this.setPlateNumber(orderTemp.getPlateNumber());
		this.setPayableFee(orderTemp.getPayableFee());
		this.setPaidFee(orderTemp.getPaidFee());
		this.setDiscountFee(orderTemp.getDiscountFee());
		this.setPayType(orderTemp.getPayType());
		this.setPayChannel(orderTemp.getPayChannel());
		if (null != opId) {
			this.setOpId(orderTemp.getOpId());
		}
		if (ObjectUtil.isNotBlank(opName)) {
			this.setOpName(orderTemp.getOpName());
		}
		this.setParkCode(orderTemp.getParkCode());
		this.setEstateId(orderTemp.getEstateId());
		this.setCreatedTime(new Date());
	}
}